package org.example.scoredata;

import org.example.ConnectDatabase;
import org.example.Server;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class SeeAllSocres extends ConnectDatabase {
    public SeeAllSocres(){};
    public int see(){
        new ConnectDatabase();
        Statement sql,sql1;
        ResultSet rs,rs1;
        Score result;
        String str = "select * from HistoryScore";
        int imf = 0;
        try {
            sql = con.createStatement();
            rs = sql.executeQuery(str);
            while (rs.next()) {
                result = new Score();
                result.setS_ID(rs.getString(2));
                result.setScore(rs.getInt(3));
                Server.SocrearrayList.add(result);
                imf ++;
            }
            con.close();
        }catch (SQLException e){}
        return imf;
    }
}
